package com.firefly.dao.dto.ums;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import java.io.Serializable;

/**
 * @description: 部门创建/修改数据类
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/11/30
 **/
@Data
@EqualsAndHashCode(callSuper = false)
public class DepartmentDto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Positive(groups = {update.class},message = "ID是大于0的整数")
    private Integer id;
    @PositiveOrZero(groups = {create.class},message = "父级分类输入大于0的整数")
    @NotNull(groups = {create.class,update.class},message = "父级必填")
    private Integer parentId;
    @NotBlank(groups = {create.class,update.class},message = "名称必填")
    private String name;
    @Range(min=0,max=1,groups= {update.class, create.class},message = "状态必填")
    private Integer status;
    // 分组校验
    public interface create{}
    public interface update{}
}
